<?php
/**
* $Id: edit_del_article.php 153 2010-05-05 22:22:48Z bwanglei $
*/

include_once(dirname(__FILE__).'/init.php');

// 删除文章
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
	if (isset($_POST['article_id'])) $del_aid = $_POST['article_id'];
	if (!apf_del_article($del_aid)) {
		apf_msg('删除帖子出现错误！',apf_full_url());
		die();
	}
}

$per_page = 15;
$page_count = apf_user_article_page_count($_SESSION['username'],$per_page);

if (isset($_GET['page'])) {
	$page_num = intval($_GET['page']);
	if ($page_num<0) $page_num = 0;
	if ($page_num>($page_count-1)) $page_num = $page_count;
} else {
	$page_num = 0;
}

$user_articles = apf_get_user_articles($_SESSION['username'],$page_count,$per_page,$page_num);
include_once(TEMP_ROOT_PATH.'/edit_del_article.php');
?>
